<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags" %>

<div id="login-logout-alto" align="right">

 <div id="sfondo_carrello"> 

	<div id="scritte_logout_carrello" align="center">
	
        <s:if test="#session.loggedUser == null">
            <a href="<s:url action='home'/>" class="carrello">Login</a><br/>
            <s:if test="#session.carrello == null">
	            <a href="<s:url action='showCarrello'/>" class="carrello">Carrello: 0 articoli</a><br/>
	        </s:if>
	        <s:else>
	            <a href="<s:url action='showCarrello'/>" class="carrello">Carrello: <s:property value="#session.carrello.carrello.size()"/> articoli</a><br/>
	        </s:else>
        </s:if>
        <s:else>
            Benvenuto/a <s:property value="#session.loggedUser.username"/><br/>  
	        <s:if test="#session.loggedUser.amministratore == false">
	        <s:if test="#session.carrello == null">
	            <a href="<s:url action='showCarrello'/>" class="carrello">Carrello: 0 articoli</a><br/>
	        </s:if>
	        <s:else>
	            <a href="<s:url action='showCarrello'/>" class="carrello">Carrello: <s:property value="#session.carrello.carrello.size()"/> articoli</a><br/>
	        </s:else>
	        </s:if>
	            <a href="<s:url action='logout'/>" class="carrello">Logout</a>
        </s:else>
    </div>

     <div id="carrello"><a href="<s:url action='showCarrello'/>" class="carrello"></a></div>
       
         </div>
          </div>
      

       
    <div id="menu">
        <ul>
          <s:if test="#session.loggedUser == null">
          <li><a href="<s:url action='home'/>" class="menu">Home</a></li>
          </s:if>
          <s:else>
          <li><a href="<s:url action='home_search'/>" class="menu">Home</a></li>
          </s:else>
          <li><a href="<s:url action='catalogo'/>" class="menu">Catalogo</a></li>
          <s:if test="#session.loggedUser == null">
          <li><a href="<s:url action='showFormRegistrazione'/>" class="menu">Registrati</a></li>
          <li><a href="<s:url action='contacts'/>" class="menu">Contatti</a></li>
          <li><a href="<s:url action='regolamento'/>" class="menu">Regolam.</a></li>
          </s:if>
          <s:if test="#session.loggedUser != null && #session.loggedUser.amministratore == false">
          <li><a href="<s:url action='ordini_utente'/>" class="menu">Acquisti</a></li>
          <li><a href="<s:url action='inserzioni_utente'/>" class="menu">Inserzioni</a></li>
          <li><a href="<s:url action='ricapitolazioneDati'/>" class="menu">Dati Utente</a></li>
          </s:if>
          <s:if test="#session.loggedUser != null && #session.loggedUser.amministratore == true">
          <li><a href="<s:url action='gestione_categorie'/>" class="menu">Categorie</a></li>
          <li><a href="<s:url action='gestione_utenti'/>" class="menu">Utenti</a></li>
          <li><a href="<s:url action='gestione_ordini'/>" class="menu">Ordini</a></li>
          </s:if>
        </ul>
       
      </div>
      
      
      
                    
 <div id="control_and_error_message2">
<span class="midboldtxt"><s:actionmessage/></span>   

<s:fielderror cssClass="register" theme="simple"><s:param> password </s:param> <s:param> username</s:param></s:fielderror>
<span class="midboldtxt"><s:actionerror /></span> 
     	</div>